package com.ruoyi.session.mapper;

import com.ruoyi.session.domain.Session;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author xgw
 */
public interface SessionMapper {

    //查询出所有存在的Session
    public List<Session> selectExistSession();

    //根据id查询Session
    public Session selectSessionById(@Param("sessionId")Integer sessionId);

    //根据userId查询Session
    public List<Session> selectSessionByUserId(@Param("userId")Integer userId);

    public Session selectSessionByUserIdAndTitle(@Param("userId")Integer userId,@Param("title")String title);

    //增加Session
    public int insertSession(@Param("session")Session session);

    //删除SessionId
    public int deleteSessionById(@Param("sessionId")Integer sessionId);

    //动态多条件查询
    public List<Session> dynamicSelectSession(@Param("username") String username, @Param("strategyId")Integer strategyId, @Param("title")String title);

    //模糊查询出符合搜索的会话标题
    public List<Session> selectSessionBySearch(@Param("title") String title,@Param("userId") Integer userId);

    //更新回话标题
    public int updateSessionById(@Param("sessionId") Integer sessionId,@Param("title") String title);

}
